{% extends "site_base.html" %}
{% block body %}
	<div id="page-container">
                        <!-- Lewa kolumna START -->
                            <!-- Post -->
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                    </div>
                                    <div class="box-content">
                                        <div class="line">
                                            <span class="button-border"><span class="date alert">{{ post.dataDodania.date }}</span></span>
                                            <span class="content tag-big strong single-post"> {{ post.tytul }} </span>
                                            <span class="comments no-margin">
						{% if post.liczba_komentarzy %}
							<p>komentarze:{{ post.liczba_komentarzy }}</p>
						{% else %}
							<p>brak komentarzy</p>
						{% endif %}
					    </span>
                                        </div>
                                        <hr />
                                        <div class="text single-post">
					{% autoescape off %}
         					{{ post.tresc }}
					{% endautoescape %}
                                        </div>
                                        {% if post.czyKomentarz %}
                                        <div class="comments">
                                            <p class="tag-normal strong color-orange">Komentarze</p>
					    {% if komentarze %}
						 {% for komentarz in komentarze.object_list %}						
						<p class="comment first">
                                                <span>{{ komentarz.dataDodania.date }}</span> 
						     <span class="color-orange">»</span> <spanclass="strong">{{ post.autor.first_name }} {{ post.autor.last_name }}</span><br />
						     {% autoescape off %}
                                                      <span class="comment">{{ komentarz.tresc }}</span>
						    {% endautoescape %}
						{% endfor %}
					    {% endif %}    
                                            </p>
                                        </div>
                                        <div class="new-comment">
                                            <p class="tag-normal strong color-orange">Dodaj swój komentarz</p>
                                            <form method="POST" action="." enctype="">
                                                <fieldset>
                                                   {% for field in form %}
                            				{{ field }}
                            			   {% endfor %}
                                                    <p class="right">
                                                        <span class="button-border">
                                                            <input type="submit" name="save" value="dodaj komentarz" />
                                                        </span>
                                                    </p>
                                                </fieldset>
                                            </form>
                                        </div>
				        {% endif %}
                                    </div>
                                </div>
                            </div>
                            <!-- Post #1 Koniec -->

                        <!-- Lewa kolumna KONIEC -->
                </div>
                <div id="page-container-2">
                        <!-- Prawa kolumna START -->
                            <!-- Adminka wpisu -->
                            <div class="admin">
                                <span class="button-border"><span class="button"><a href="{% url post_usun id=post.id %}">usun wpis</a></span></span>
                                <span class="button-border"><span class="button"><a href="{% url post_edytuj id=post.id %}">edytuj wpis</a></span></span>
                            </div>
                            <!-- Adminka wpisu KONIEC-->
                            <!-- Autor -->
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>O autorze</span>
                                        </span>
                                    </div>
                                    <div class="box-content">
                                        <p class="author">
                                            <span class="avatar">
                                                <img alt="" src="{{ MEDIA_URL }}css/gfx/icons/no-foto-normal.gif" />
                                            </span>
                                            <span class="data">
                                                <strong>{{ post.autor.first_name }} {{ post.autor.last_name }}</strong><br />
                                            </span>
                                            <span class="icons">
                                                <span class="color-gray">@</span><span class="color-orange">online</span><br />
                                                <img alt="" src="{{ MEDIA_URL }}css/gfx/icons/plus-white.gif" /><img alt="" src="{{ MEDIA_URL }}css/gfx/icons/show-white-2.gif" /><img alt="" src="{{ MEDIA_URL }}css/gfx/icons/message-white.gif" />
                                            </span>
                                        </p>
                                        <hr />
                                        <p class="last-posts">
                                            <strong>Ostatnie wpisy</strong><br />
					     {% for post in ostatnie_posty %}
                                            <p><span class="color-orange">»</span> <a href="{{ post.get_absolute_url }}">{{ post.tytul }}</a></p>
					     {% endfor %}
                                        </p>
                                        <p class="forum-activity">
                                            <strong>Aktywność na forum</strong><br />
                                            Sekcja PR <span class="color-orange">»</span> Dyskusja
                                        </p>
                                    </div>
                                </div>
                            </div>
                            <!-- Autor KONIEC -->
                            <!-- Prawa kolumna KONIEC -->
                </div>
            </div>
{% endblock %}
